package online.afeibaili.storebackendframework.util


/**
 * 运行时时间计算
 *
 *@author AfeiBaili
 *@version 2025/10/21 17:00
 */

class RuntimeTimeUtil(run: () -> Unit) {
    var time: Long = 0

    init {
        val startTime: Long = System.currentTimeMillis()
        run.invoke()
        val endTime: Long = System.currentTimeMillis()
        time = endTime - startTime
    }

    fun printTime() = println("Runtime time: ${time}ms")
}